home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 708 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: inforamp.net!usenet
  2. From: pcurran@inforamp.net (Peter Curran)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Restrictions on qsort compare function?
  5. Date: Mon, 08 Apr 1996 17:14:13 GMT
  6. Organization: PSC Enterprises
  7. Message-ID: <4kbl1l$74r@sam.inforamp.net>
  8. References: <4iokop$h4p@lyra.csx.cam.ac.uk> <4iqjar$2m9@usenet.pa.dec.com> <4jgltp$f9l@lyra.csx.cam.ac.uk> <828644274snz@genesis.demon.co.uk> <4k28t4$2g0@sam.inforamp.net> <828726582snz@genesis.demon.co.uk> <4k69bf$ehg@sam.inforamp.net> <828971813snz@genesis.demon.co.uk>
  9. Reply-To: pcurran@inforamp.net
  10. NNTP-Posting-Host: ts53-08.tor.istar.ca
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. On Mon, 08 Apr 96 13:56:53 GMT in article <828971813snz@genesis.demon.co.uk>
  14.     Lawrence Kirby <fred@genesis.demon.co.uk> (Lawrence Kirby) wrote:
  15.  
  16. >>IMHO, qsort() is required to return an array that is sorted according to the
  17. >>criteria implied by the comparison function.  That is, at the point where qsort
  18. >>returns, the array must match the order implied by the comparison function.
  19.  
  20. The comparison function I postulated *is* consistent, at any instant in time.
  21. (Just to be clear - another correspondent suggested my original posting may not
  22. have said quite what I intended.  The comparison function I suggested., or
  23. intended, calculates as result by comparison of the values pointed at by the
  24. parameters, in a way we can all agree is acceptable.  However, it then calls
  25. time(), and if the result it odd it negates the result before returning it.  In
  26. a conventional implementation of time(), it reverses the order every second, but
  27. defines a consistent order at any given time.)
  28.  
  29. >The critical word is 'sorted'. I suggest you read section 5 (i.e. the
  30. >first section of chapter 5) in Knuth Vol 3 to get a reasonable idea of what
  31. >a sort is. 
  32.  
  33. I can assure you that I read Knuth cover to cover, within a few weeks of its
  34. first publication.  I really don't think this kind of insult is necessary here.
  35.  
  36. There isn't much point in continuing this.  We will have to agree to disagree.
  37. I understand how you are reaching the conclusions you are reaching (and I agree
  38. it should be possible to reach them).  However I think that you are stretching
  39. the text of the standard beyond the breaking point to get there.
  40.  
  41. --
  42. Peter Curran                               pcurran@inforamp.net
  43.  
  44.